/**
 * 
 */
package com.cea.papyrus.diagram.usecase.command;

import org.eclipse.uml2.uml.Actor;
import org.eclipse.uml2.uml.UseCase;

import com.cea.papyrus.core.commands.Di2UMLElementCreateCommand;
import com.cea.papyrus.diagraminterchange2.di2.GraphElement;

/**
 * Subclass to return  commands appropriate to this diagram.
 * @author dumoulin
 *
 */
public class UMLDi2ElementCreateFactory extends com.cea.papyrus.core.commands.factories.UMLDi2ElementCreateFactory {

    
    /**
     * Singleton instance of the factory.
     */
    public static UMLDi2ElementCreateFactory eINSTANCE = new UMLDi2ElementCreateFactory();

    
    /**
     * Override to return specific commands.
     */
  @Override
public Di2UMLElementCreateCommand createCommand(Object element, GraphElement parent, String typeDiagram) {
      
      if(element.equals(Actor.class)){
          return new DI2UMLActorCreateCommand((Class)element,parent,typeDiagram);
      }
      else if(element.equals(UseCase.class)){
          return new DI2UMLUseCaseCreateCommand((Class)element,parent,typeDiagram);
      }
      
    return super.createCommand(element, parent, typeDiagram);
}
}
